-
Notifications
You must be signed in to change notification settings - Fork 12.2k
ERC7579: prevent installing/uninstalling without proper initData #5974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ERC7579: prevent installing/uninstalling without proper initData #5974
Conversation
|
Walkthrough
Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)test/account/extensions/AccountERC7579.behavior.js (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Not sure if a changeset is required. I would mention the addition of the custom errors but that's probably the only thing to note. People don't rely on errors for critical functionality anyway |
I think it could be nice to have a changeset. This is technically breaking |
) internal pure virtual returns (address module, bytes calldata innerSignature) { | ||
return (address(bytes20(signature[0:20])), signature[20:]); | ||
require(signature.length > 19, ERC7579InvalidModuleSignature()); | ||
return (address(bytes20(signature)), signature[20:]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that isValidSignature
is already avoiding that this function is called with a signature that's less than 20 bytes long:
function isValidSignature(bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) {
if (signature.length >= 20) {
(address module, bytes calldata innerSignature) = _extractSignatureValidator(signature);
...
I would suggest reverting this change and just noting that the function does expect a signature of at least 20 bytes. Otherwise this will add an extra (and arguably unnecessary) check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you agree with keeping _extractSignatureValidator
as it is right now
* | ||
* This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions. | ||
* | ||
* NOTE: This function expects the signature to be at least 20 bytes long. Panics with {Panic-ARRAY_OUT_OF_BOUNDS} (0x32) otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ernestognw Any reason to prefer a Panic over a custom error ?
Followup to #5961
Replaces #5971
PR Checklist
npx changeset add
)